package cn.service;

import java.text.ParseException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.stereotype.Service;

import cn.entity.Teacher;
import cn.mapper.TeacherMapper;
@Service(value="teacherService")
public class TeacherServiceImpl implements TeacherService {
	
	private TeacherMapper teacherMapper;
	@Autowired
	public void setTeacherMapper(TeacherMapper teacherMapper) {
		this.teacherMapper = teacherMapper;
	}

	@Override
	public void add(Teacher teacher) {
		// TODO Auto-generated method stub
		teacherMapper.add(teacher);
	}

	@Override
	public Teacher login(Map map) {
		// TODO Auto-generated method stub
		return teacherMapper.login(map);
	}

	@Override
	public void delete(Integer en_id) {
		// TODO Auto-generated method stub
		teacherMapper.delete(en_id);
	}

	@Override
	public void update(Teacher teacher) {
		// TODO Auto-generated method stub
		teacherMapper.update(teacher);
		
	}

	@Override
	public Teacher get(Map map) {
		// TODO Auto-generated method stub
		return teacherMapper.get(map);
	}

	@Override
	public List<Teacher> find(Map map) {
		// TODO Auto-generated method stub
		return teacherMapper.find( map);
	}

	@Override
	public List<Teacher> findby(Map map) {
		// TODO Auto-generated method stub
		return teacherMapper.findby(map);
	}

	@Override
	public Integer checkName(String tname) {
		// TODO Auto-generated method stub
		return teacherMapper.checkName(tname);
	}

	@Override
	public void addmiddlesubject(Map map) {
		// TODO Auto-generated method stub
		teacherMapper.addmiddlesubject(map);
	}

	@Override
	public void addmiddleclass(Map map) {
		// TODO Auto-generated method stub
		teacherMapper.addmiddleclass(map);
	}

	@Override
	public Teacher findone(String tname) {
		// TODO Auto-generated method stub
		return teacherMapper.findone(tname);
	}
	//添加中间表

	@Override
	public void updatepassword(Teacher teacher) {
		// TODO Auto-generated method stub
	 teacherMapper.updatepassword(teacher);
	}
	

}
